import request from "@/utils/functions/request";

// 获取菜单
export function loadMenuApi(params: any): Promise<any> {
  return request({
    url: "/user_right/loadMenu",
    method: "get",
    params
  });
}

// 创建菜单
export function ledgerMenuFormApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuFormList",
    method: "post",
    data
  });
}

// 删除菜单
export function ledgerMenuDelApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuDel",
    method: "get",
    params
  });
}

// 查看已添加的菜单
export function ledgerMenuTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuTab",
    method: "get",
    params
  });
}

// 根据菜单 id 查询字段
export function ledgerMenuTableFieldListApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/ledgerMenuTableFieldList",
    method: "get",
    params
  });
}

// 数据权限新增
export function ledgerMenuAuthFormApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-auth-do/ledgerMenuAuthForm",
    method: "post",
    data
  });
}

// 功能配置新增
export function ledgerMenuFuncFormListApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-func-do/ledgerMenuFuncFormList",
    method: "post",
    data
  });
}

// 根据菜单 id 查询数据权限
export function ledgerMenuAuthTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-auth-do/ledgerMenuAuthTab",
    method: "get",
    params
  });
}

// 上传导入模板
export function uploadApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-func-do/upload",
    method: "post",
    headers: {
      "Content-Type": "application/form-data;charset=utf-8"
    },
    data
  });
}

// 根据菜单 id 查询功能列表
export function ledgerMenuFuncTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-func-do/ledgerMenuFuncTab",
    method: "get",
    params
  });
}

// 获取用户列表
export function userListApi(params = {}): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-do/userList",
    method: "get",
    params
  });
}

// 保存查询条件
export function ledgerMenuQueryFormListApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-query-do/ledgerMenuQueryFormList",
    method: "post",
    data
  });
}

// 根据菜单 id 查询查询
export function ledgerMenuQueryTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-query-do/ledgerMenuQueryTab",
    method: "get",
    params
  });
}

// 添加流转配置
export function ledgerMenuTosetFormApi(data: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-toset-do/ledgerMenuTosetForm",
    method: "post",
    data
  });
}

// 根据菜单 id 查询查询
export function ledgerMenuTosetTabApi(params: any): Promise<any> {
  return request({
    url: "/cdledger/ledger-menu-toset-do/ledgerMenuTosetTab",
    method: "get",
    params
  });
}

// 用户模块添加权限
export function addRightApi(data: any): Promise<any> {
  return request({
    url: "/cquser/user_right/addRight",
    method: "post",
    data
  });
}

// 用户模块删除权限
export function delRightApi(params: any): Promise<any> {
  return request({
    url: "/user_right/delRight",
    method: "get",
    params
  });
}

// 查询组织下的用户 
export function getUserListByOrgIDApi(data: any): Promise<any> {
  return request({
    url: "/cquser/user_user/listUserByOrg",
    method: "post",
    data
  });
}